#include <iostream>
#include <string>
#include <vector>
using namespace std;

struct my_stu
{
public:
    string name;
    int id;

    my_stu()
    {

    }
    my_stu(string name ,int id)
        :name(name) , id(id)
    {

    }
    
};


int main(int argc, char const *argv[])
{
    vector<int> v1;

    cout << "v1的大小" << v1.size() << endl;

    vector<int> v2(10,50);

    cout << "v2的大小 " << v2.size() << "v2 的值" << v2.at(9) << endl;

    for (size_t i = 0; i < 10; i++)
    {
        v2[i] = i;
    }
    
    cout << "v2 的值" << v2.front() << endl;
    cout << "v2 的值" << v2.back() << endl;

    for ( auto it = v1.begin(); it != v1.end(); ++it)
    {
        cout << * it << endl;
    }
    
    vector<my_stu> v3;

    v3.push_back(my_stu("张三",10));
    v3.push_back(my_stu("张四",10));
    v3.push_back(my_stu("张五",10));
    v3.push_back(my_stu("张六",10));

    for (auto it = v3.begin(); it != v3.end(); it++)
    {
        cout << (*it).id << endl;
        cout << (*it).name << endl;
    }
    
    return 0;
}
